package com.hyk.learning.test.client;

import com.hyk.learning.annotation.RpcReference;
import com.hyk.learning.test.helloApi.Hello;
import com.hyk.learning.test.helloApi.HelloService;
import org.springframework.stereotype.Component;

/**
 * @className: HelloController
 * @author: hyk199710
 * @description: TODO
 * @date: 2024/5/21 23:01
 */
@Component
public class HelloController {
    @RpcReference(version = "version1", group = "test1", weight = 100, warmupTS = 600000, timeout = 1000)
    private HelloService helloService;

    public void test() throws InterruptedException {
        String hello = this.helloService.hello(new Hello("111", "222"));
//        Thread.sleep(12000);
        for (int i = 0; i < 10; i++) {
            System.out.println(helloService.hello(new Hello("111", "222")));
        }
    }
}
